import request from '@/utils/request'

// 查询创客导师列表
export function listMentor(query) {
  return request({
    url: '/system/mentor/list',
    method: 'get',
    params: query
  })
}

// 查询创客导师详细
export function getMentor(mentorId) {
  return request({
    url: '/system/mentor/' + mentorId,
    method: 'get'
  })
}

// 新增创客导师
export function addMentor(data) {
  return request({
    url: '/system/mentor',
    method: 'post',
    data: data
  })
}

// 修改创客导师
export function updateMentor(data) {
  return request({
    url: '/system/mentor',
    method: 'put',
    data: data
  })
}

// 删除创客导师
export function delMentor(mentorId) {
  return request({
    url: '/system/mentor/' + mentorId,
    method: 'delete'
  })
}

export function uploadFile(data) {
  return request({
    url: '/upload/image',
    method: 'post',
    data:data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 上传单张图片
// export function uploadSingleImage(file) {
//   const formData = new FormData();
//   formData.append('file', file);
//   console.log("调用这个接口了");
  
//   return request({
//     url: '/upload/image',
//     method: 'post',
//     data: formData,
//     headers: { 'Content-Type': 'multipart/form-data' }
//   });
// }


